<?php
include 'user.php';

$user = new User; 
$user->init($_SESSION['id'],$_SERVER['REMOTE_ADDR'],time()+180);
$user->del_unactivity();
if(!$user->is_exist())
    $user->insert();
else{
    $user->del();
    $user->insert();
}

?>